<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

$api = app('Dingo\Api\Routing\Router');

$api->version('v1',function ($api){

        $api->group(['namespace'=>'App\Http\Controllers\Api','middleware'=>['cors']],function ($api) {
            $api->post('/get_token/','HomeController@get_token');
            $api->post('/get_city/','HomeController@get_city');
            $api->post('/get_options/','HomeController@get_options');
            $api->post('/add_language/','HomeController@add_language');
            $api->post('/test/','HomeController@test');
            $api->post('/login/','HomeController@login');
            $api->post('/verify_cinema_info/','HomeController@verify_cinema_info');
            $api->post('/add_cinema_account/','HomeController@add_cinema_account');
            $api->post('/get_cinema_status/','HomeController@get_cinema_status');
        });

        $api->group(['namespace'=>'App\Http\Controllers\Api','middleware'=>['cors']],function ($api){


        //院线
        $api->post('/chains/index','ChainsController@index');
        $api->post('/manager_logs','HomeController@manager_logs');
        $api->post('/chains/info','ChainsController@info');
        $api->post('/chains/add_cinema','ChainsController@add_cinema');
        $api->post('/chains/edit_cinema','ChainsController@edit_cinema');
        $api->post('/chains/delete_cinema','ChainsController@delete_cinema');
        $api->post('/chains/restore_cinema','ChainsController@restore_cinema');
        $api->post('/chains/get_cinema_info','ChainsController@get_cinema_info');
        $api->post('/chains/add_online_film_ticketer','ChainsController@add_online_film_ticketer');
        $api->post('/chains/get_onilne_film_ticketer_publishkey','ChainsController@get_onilne_film_ticketer_publishkey');
        $api->post('/chains/get_online_film_ticketer_list','ChainsController@get_online_film_ticketer_list');
        $api->post('/chains/delete_online_film_ticketer','ChainsController@delete_online_film_ticketer');
        $api->post('/chains/stop_online_film_ticketer','ChainsController@stop_online_film_ticketer');
        $api->post('/chains/restore_online_film_ticketer','ChainsController@restore_online_film_ticketer');
        $api->post('/chains/edit_online_film_ticketer','ChainsController@edit_online_film_ticketer');
        $api->post('/chains/get_zhuanzi_notice','ChainsController@get_zhuanzi_notice');
        $api->post('/chains/change_cinema_reset_password','ChainsController@change_cinema_reset_password');
        $api->post('/chains/update_software_version','ChainsController@update_software_version');
        $api->post('/chains/get_software_version','ChainsController@get_software_version');



        //影院
        $api->post('/cinemas/index','CinemasController@index');
        $api->post('/cinemas/edit','CinemasController@edit');
        $api->post('/cinemas/set_operating_status','CinemasController@set_operating_status');
        $api->post('/cinemas/complete_cinema_info','CinemasController@complete_cinema_info');
        $api->post('/cinemas/add_ticket_type','CinemasController@add_ticket_type');
        $api->post('/cinemas/edit_ticket_type','CinemasController@edit_ticket_type');
        $api->post('/cinemas/delete_ticket_type','CinemasController@delete_ticket_type');
        $api->post('/cinemas/get_ticket_type_list','CinemasController@get_ticket_type_list');
        $api->post('/cinemas/edit_pricing_plan','CinemasController@edit_pricing_plan');
        $api->post('/cinemas/add_pricing_plan','CinemasController@add_pricing_plan');
        $api->post('/cinemas/delete_pricing_plan','CinemasController@delete_pricing_plan');
        $api->post('/cinemas/pricing_plan_list','CinemasController@pricing_plan_list');
        $api->post('/cinemas/plan_add_type','CinemasController@plan_add_type');
        $api->post('/cinemas/add_online_film_ticketer','CinemasController@add_online_film_ticketer');
        $api->post('/cinemas/set_online_film_ticket','CinemasController@set_online_film_ticket');
        $api->post('/cinemas/stop_online_film_ticketer','CinemasController@stop_online_film_ticketer');
        $api->post('/cinemas/delete_online_film_ticketer','CinemasController@delete_online_film_ticketer');
        $api->post('/cinemas/restore_online_film_ticketer','CinemasController@restore_online_film_ticketer');
        $api->post('/cinemas/get_online_film_ticketer','CinemasController@get_online_film_ticketer');
        $api->post('/cinemas/get_not_cooperation_film_ticketer','CinemasController@get_not_cooperation_film_ticketer');

        //影厅
        $api->post('/screen/lists','ScreenController@lists');
        $api->post('/screen/add_screen','ScreenController@add_screen')->middleware('screen');
        $api->post('/screen/edit_screen','ScreenController@edit_screen')->middleware('screen');
        $api->post('/screen/delete_screen','ScreenController@delete_screen');
        $api->post('/screen/index','ScreenController@index');
        $api->post('/screen/add_seat','ScreenController@add_seat');
        $api->post('/screen/seat_info','ScreenController@seat_info');
        $api->post('/screen/edit_seat','ScreenController@edit_seat');
        $api->post('/screen/delete_seat','ScreenController@delete_seat');

        //项目
        $api->post('/project/zhuanzi_list','ProjectController@zhuanzi_list');
        $api->post('/project/add_film','ProjectController@add_film');
        $api->post('/project/edit_film','ProjectController@edit_film');
        $api->post('/project/delete_film','ProjectController@delete_film');
        $api->post('/project/index','ProjectController@index');
        $api->post('/project/info','ProjectController@info');
        $api->post('/project/get_project_info','ProjectController@get_project_info');
        $api->post('/project/film_info_query','ProjectController@film_info_query');

        //排场
        $api->post('/session/add_layout_film','SessionController@add_layout_film');
        $api->post('/session/get_layout_films','SessionController@get_layout_films');
        $api->post('/session/get_about_layout_films','SessionController@get_about_layout_films');
        $api->post('/session/add','SessionController@add');
        $api->post('/session/index','SessionController@index');
        $api->post('/session/film_list','SessionController@film_list');
        $api->post('/session/get_film_tickets','SessionController@get_film_tickets');
        $api->post('/session/set_session_price_plan','SessionController@set_session_price_plan');
        $api->post('/session/add_playthrough','SessionController@add_playthrough');
        $api->post('/session/get_playthrough','SessionController@get_playthrough');
        $api->post('/session/delete_playthrough','SessionController@delete_playthrough');
        $api->post('/session/set_share_proportion','SessionController@set_share_proportion');
        $api->post('/session/set_seat_by_number','SessionController@set_seat_by_number');
        $api->post('/session/stop_showtime_schedules','SessionController@stop_showtime_schedules');
        $api->post('/session/restart_showtime_schedules','SessionController@restart_showtime_schedules');
        $api->post('/session/delete_showtime_schedules','SessionController@delete_showtime_schedules');
        $api->post('/session/get_session_list','SessionController@get_session_list');

        //订单
        $api->post('/order/select_film','OrderController@select_film');
        $api->post('/order/local_lock_seat','OrderController@local_lock_seat');
        $api->post('/order/local_release_seat','OrderController@local_release_seat');
        $api->post('/order/local_submit_order','OrderController@local_submit_order');
        $api->post('/order/check_ticket','OrderController@check_ticket');
        $api->post('/order/local_refund_ticket_by_code','OrderController@local_refund_ticket_by_code');
        $api->post('/order/local_refund_ticket_by_seat','OrderController@local_refund_ticket_by_seat');
        $api->post('/order/refund_ticket_list','OrderController@refund_ticket_list');
        $api->post('/order/board','OrderController@board');
        $api->post('/order/get_board_list','OrderController@get_board_list');
        $api->post('/order/verify_print_status','OrderController@verify_print_status');
        $api->post('/order/set_order_print_status','OrderController@set_order_print_status');
        $api->post('/order/print_order_info','OrderController@print_order_info');


        //其他
        $api->post('/backup/index','BackupController@backup');
        $api->post('/backup/restore','BackupController@restore');
        $api->post('/backup/get_list','BackupController@get_list');
//        $api->post('/backup/download_file','BackupController@download_file');
        $api->post('/online_film_ticket/index','OnlineFilmTicketController@index');

        //票房统计上报
        $api->post('statisticalReport/index','StatisticalReportController@index');
        $api->post('statisticalReport/order_original','StatisticalReportController@order_original');
        $api->post('statisticalReport/get_logs','StatisticalReportController@get_logs');
        $api->post('statisticalReport/add_settlement_reports','StatisticalReportController@add_settlement_reports');
        $api->post('statisticalReport/get_settlement_reports','StatisticalReportController@get_settlement_reports');
        $api->post('statisticalReport/get_business_report_status','StatisticalReportController@get_business_report_status');
        $api->post('statisticalReport/statement_info','StatisticalReportController@statement_info');
        $api->post('statisticalReport/get_report_logs','StatisticalReportController@get_report_logs');

        //用户、角色权限管理
        $api->post('roles/permission','RolesController@permission');
        $api->post('roles/add','RolesController@add');
        $api->post('roles/restore_roles','RolesController@restore_roles');
        $api->post('roles/edit','RolesController@edit');
        $api->post('roles/index','RolesController@index');
        $api->post('roles/delete','RolesController@delete');
        $api->post('roles/info','RolesController@info');
        $api->post('user/index','UserController@index');
        $api->post('user/add','UserController@add');
        $api->post('user/edit','UserController@edit');
        $api->post('user/change_user_status','UserController@change_user_status');
        $api->post('user/info','UserController@info');
        $api->post('user/change_password','UserController@change_password');
        $api->post('user/reset_password','UserController@reset_password');
        $api->post('user/logout','UserController@logout');

        //附录D、E报文
        $api->post('message/refund','MessageController@refund');
        $api->post('message/original_data','MessageController@original_data');
    });

});

//xml
Route::post('xml/readTest','Xml\IndexController@readTest')->middleware('cors');
Route::post('xml/reader','Xml\IndexController@reader')->middleware('cors');
Route::post('xml/index','Xml\IndexController@index')->middleware('cors');
Route::post('xml/data_report','Xml\DataReportController@index')->middleware('cors');
Route::post('json/data_report','Xml\DataReportController@json_index')->middleware('cors');
Route::post('xml/get_data_report','Xml\DataReportController@xml_index')->middleware('cors');


Route::get('/', function () {
    return view('welcome');
});

Route::get('/install',function (){
   return view('install');
});
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');

Route::get('api/backup/download_file','Api\BackupController@download_file');



